package src.model.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "MOVIE", schema = "HB")
@SequenceGenerator(name = "SEQ_GEN", sequenceName = "MOV_SEQ", initialValue = 1, allocationSize = 1)
public class Movies extends abstractEntity {

	private String movieName;
	private Actors actors;
	private Directors directors;
	private Seans seans;
	private Types types;
	private String Year;
	private Saloons saloons;

	@Column(name="MOVIE_NAME")
	public String getMovieName() {
		return movieName;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="ACTOR_ID")
	public Actors getActors() {
		return actors;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="DIRECTOR_ID")
	public Directors getDirectors() {
		return directors;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="SEANS_ID")
	public Seans getSeans() {
		return seans;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="TYPE_ID")
	public Types getTypes() {
		return types;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="SALOON_ID")
	public Saloons getSaloons() {
		return saloons;
	}

	public void setMovieName(String movieName) {
		this.movieName = movieName;
	}

	public void setActors(Actors actors) {
		this.actors = actors;
	}

	public void setDirectors(Directors directors) {
		this.directors = directors;
	}

	public void setSeans(Seans seans) {
		this.seans = seans;
	}

	public void setTypes(Types types) {
		this.types = types;
	}

	public void setSaloons(Saloons saloons) {
		this.saloons = saloons;
	}

	@Column(name="CREATE_YEAR")
	public String getYear() {
		return Year;
	}

	public void setYear(String year) {
		Year = year;
	}

	@Override
	public String toString() {
		return "Movies [movieName=" + movieName + ", actors=" + actors
				+ ", directors=" + directors + ", seans=" + seans + ", types="
				+ types + ", Year=" + Year + ", saloons=" + saloons + "]";
	}

}
